#include <iostream>
#include <iomanip>
using namespace std;

#include "ClassTimeApart.h"

Time::Time() 
{
	hour = minute = second = 0;
}
void Time::setTime(int h, int m, int s)
{
	hour = (h>=0 && h<24) ? h : 0;
	minute = (m >=0 && m <= 59) ? m : 0;
	second = (s >=0 && s <=59) ? s : 0;
}
void Time::printTimeUniversal()
{
	cout << setfill('0') << setw(2) << hour << ":"
			<< setw(2) << minute << ":"
			<< setw(2) << second << endl; 
}
void Time::printTimeStandard()
{
	cout << setfill('0') << setw(2) << ((hour==0 || hour == 12) ? 12 : hour%12)  << ":"
			<< setw(2) << second << ":"
			<< setw(2) << minute << (hour<12 ? "AM" : "PM") << endl;
}

